//
//  ScrollSprite.h
//  StarBugs
//
//  Created by ?? ? on 6/25/12.
//  Copyright 2012 antisword@playorca.com. All rights reserved.
//

#ifndef __ScrollSprite_h__
#define __ScrollSprite_h__

#include "cocos2d.h"

class ScrollSprite : public cocos2d::CCLayer
{
private:
    cocos2d::CCSprite *scrollBar;
    cocos2d::CCSprite *scrollButton;
    cocos2d::CCSize winSize;
    static ScrollSprite *pScrollSprite;
    bool    isShow;
public:
    ScrollSprite(); 
    ~ScrollSprite();
    
    static ScrollSprite& getInstance()
    {
        if(pScrollSprite == NULL) pScrollSprite = new ScrollSprite;
        return *pScrollSprite;
    }
    
    static ScrollSprite* getInstancePtr()
    {
        if(pScrollSprite == NULL) pScrollSprite = new ScrollSprite;
        return pScrollSprite;
    }
    
    void setIsShow(bool flg);
    void showScroll();
    void hideScroll();
    float setButtonPos(cocos2d::CCPoint pt);
    void setButtonRate(float rate);
    bool getIsTouchButton(cocos2d::CCPoint pt);
    void touchEndedButton();
};

#endif